package marvin.webapp.shopping.model;

import java.util.Comparator;

import marvin.webapp.shopping.displaybeans.ShoppingListDisplayBean;

public class ShoppingListComparator implements Comparator<ShoppingListDisplayBean>{

	@Override
	public int compare(ShoppingListDisplayBean o1, ShoppingListDisplayBean o2) {
		if(o1 != null && o1.getList().getCreationDate() != null && o2 !=null){
			return o2.getList().getCreationDate().compareTo(o1.getList().getCreationDate());
		}
		return -1;
	}

}
